﻿function MainContent(PageIndex)
{
  var OrderFiled=document.getElementById("Orders").value;
  var ClassId=document.getElementById("ProChidden").value;
  SendAjax("ConMain",OrderFiled,PageIndex,ClassId);
}
function SendAjax(op,OrderFiled, PageIndex,ClassId)
{

    var param = "Option="+ op +"&OF="+ OrderFiled+"&PI="+PageIndex+"&CID="+ClassId;
    var options={
        method:'post',
        parameters:param,
        onComplete:
        function(transport)
	    {
	      var retv=transport.responseText;
		  document.getElementById("MainConent").innerHTML=retv;
		}     

	  }
	
new  Ajax.Request('shopall.aspx',options);
}

 function Up(Index)
 {
      var OrderFiled=document.getElementById("Orders").value;
      var PageIndex=eval(Index)-1
	  var ClassId=document.getElementById("ProChidden").value;
      SendAjax("ConMain",OrderFiled,PageIndex,ClassId);
 }
 function Down(Index)
 {
      var OrderFiled=document.getElementById("Orders").value;
      var PageIndex=eval(Index)+1
	  var ClassId=document.getElementById("ProChidden").value;
      SendAjax("ConMain",OrderFiled,PageIndex,ClassId);
 }
  function Go()
 {
      var OrderFiled=document.getElementById("Orders").value;
	  var PageIndex=document.getElementById("Goto").value;
	  var ClassId=document.getElementById("ProChidden").value;
	  if(PageIndex=="")
	  {
	     alert("请填写您要跳至的页面!");
	  }
      SendAjax("ConMain",OrderFiled,PageIndex,ClassId);
 }
 function Orders(Order)
 {
      var str="";
      switch (Order)
	  {
	     case "Price":
		     str="VisitNo";
			 break;
			 case "dates":
			 str="StartDate";
			 break;
	  }
     document.getElementById("Orders").value=str;
	 var ClassId=document.getElementById("ProChidden").value;
	 SendAjax("ConMain",str,"1",ClassId);
 }
 function GroupBuyCommend()
 {
  SendAjaxCommend("Comment");
 }
 function SendAjaxCommend(op)
{
    var param = "Option="+ op;
    var options={
        method:'post',
        parameters:param,
        onComplete:
        function(transport)
	    {
	      var retv=transport.responseText;
		  document.getElementById("Commend").innerHTML=retv;
		  //document.write(retv);
		}     

	  }
	new  Ajax.Request('shopall.aspx',options);
}
function shopNews(str) 
{ 
     window.open (str) 
} 
//商品分类
function ProCategroies(str)
{ 
    document.getElementById("ProChidden").value=str;
    var id=eval(str);
   SendAjaxCategories("ProCategories",id)
   var OrderFiled=document.getElementById("Orders").value;
  SendAjax("ConMain",OrderFiled,"1",str);
}
function SendAjaxCategories(op,id)
{
    var param = "Option="+ op+"&ID="+id;
    var options={
        method:'post',
        parameters:param,
        onComplete:
        function(transport)
	    {
	      var retv=transport.responseText;
		  document.getElementById("ProCategories").innerHTML=retv;
		  //document.write(retv);
		}     

	  }
	new  Ajax.Request('shopall.aspx',options);
}

  function SearchShopType(ID)
  {
     var OrderFiled=document.getElementById("Orders").value;
     var param = "Option=TyContent&OrderFiled="+OrderFiled+"&OF="+ID;
    var options={
        method:'post',
        parameters:param,
        onComplete:
        function(transport)
	    {
	      var retv=transport.responseText;
		  document.getElementById("MainConent").innerHTML=retv;
		}     

	  }
new  Ajax.Request('shopall.aspx',options);
  }
